package com.example.graduatetest.model;

import com.example.graduatetest.bean.Account;
import com.example.graduatetest.callback.MCallBack;

import java.util.Random;

public class TestModel {
    public void getAccountData(String accountName, MCallBack callback){
        Random random = new Random();
        boolean isSuccess = random.nextBoolean();
        if(isSuccess){
            Account account = new Account();
            account.setName(accountName);
            account.setLevel(100);
            callback.onSuccess(account);
        }else{
            callback.onFailed();
        }
    }


}
